import request from '@/utils/request'
// 分页查询仓库
export const wareHouseAPI = (params) => request({
  url: '/api/warehouse/page',
  method: 'GET',
  params
})
// 获取下一个编码
export const nextCodeAPI = (name) => request({
  url: `/api/codeFactory/next/${name}`
})
// 新增仓库
export const addStorageAPI = (data) => request({
  url: '/api/warehouse',
  method: 'POST',
  data
})
// 查询仓库
export const searchWarehouseAPI = (id) => request({
  url: `/api/warehouse/${id}`
})
// 修改
export const editStorageAPI = (data) => request({
  url: '/api/warehouse',
  method: 'PUT',
  data
})
// 分页查询库区详细信息
export const pageDetailAPI = (params) => request({
  url: '/api/area/pageDetail',
  params
})
// 导入excel表格
export const locationUpload = (file) => request({
  url: '/api/area/importExcel',
  method: 'POST',
  data: {
    file
  },
  headers: {
    'Content-Type': 'multipart/form-data'
  }
})
// 查询全部仓库
export const searchAllWarehouseAPI = (params) => request({
  url: '/api/warehouse/list',
  params
})
// 查询全部库区
export const searchAllAreaPAI = (params) => request({
  url: '/api/area/list',
  params
})

// 查询库区总览
export const allOverviewAPI = (id) => request({
  url: `/api/area/overview/${id}`
})
// 查询全部库位详细信息

export const allListDetailAPI = (params) => request({
  url: '/api/location/listDetail',
  params
})
